/*      */ package com.ui;
/*      */ 
/*      */ import com.engine.COMMPORT;
/*      */ import com.engine.DisplayTools;
/*      */ import com.engine.IConnect;
/*      */ import com.engine.IRecv;
/*      */ import com.engine.Increment;
/*      */ import com.engine.ReadConfig;
/*      */ import com.engine.SQEngine;
/*      */ import com.engine.SaveConfig;
/*      */ import com.engine.Services;
/*      */ import java.awt.Dimension;
/*      */ import java.awt.Toolkit;
/*      */ import java.awt.event.ActionEvent;
/*      */ import java.io.File;
/*      */ import java.io.FileInputStream;
/*      */ import java.io.FileNotFoundException;
/*      */ import java.io.IOException;
/*      */ import java.io.PrintStream;
/*      */ import java.text.DecimalFormat;
/*      */ import java.text.SimpleDateFormat;
/*      */ import java.util.Calendar;
/*      */ import java.util.Properties;
/*      */ import javax.swing.AbstractAction;
/*      */ import javax.swing.Action;
/*      */ import javax.swing.ImageIcon;
/*      */ import javax.swing.JButton;
/*      */ import javax.swing.JCheckBox;
/*      */ import javax.swing.JFileChooser;
/*      */ import javax.swing.JFrame;
/*      */ import javax.swing.JLabel;
/*      */ import javax.swing.JOptionPane;
/*      */ import javax.swing.JTextField;
/*      */ import javax.swing.UIManager;
/*      */ import org.apache.log4j.Category;
/*      */ import org.apache.log4j.PropertyConfigurator;
/*      */ import org.swixml.SwingEngine;
/*      */ 
/*      */ public class SQUI extends JFrame
/*      */   implements IRecv, IConnect
/*      */ {
/*      */   private static final long serialVersionUID = 1L;
/*   43 */   static final Category log = Category.getInstance(SQUI.class);
/*      */   static final String LOG_PROPERTIES_FILE = "lib/log4j.properties";
/*      */   public static IRecv App;
/*      */   public static IConnect App1;
/*      */   private JLabel date;
/*      */   private JFrame frame;
/*      */   private DisplayTools dt;
/*      */   private JTextField ticker;
/*      */   private JTextField video;
/*      */   private JTextField ticket_counter1;
/*      */   private JTextField ticket_counter2;
/*      */   private JTextField ticket_counter3;
/*      */   private JTextField ticket_counter4;
/*      */   private JTextField ticket_counter5;
/*      */   private JTextField ticket_counter6;
/*      */   private JTextField ticket_counter7;
/*      */   private JTextField ticket_counter8;
/*      */   private JTextField ticket_counter9;
/*      */   private JTextField ticket_counter10;
/*      */   private JTextField ticket_counter11;
/*      */   private JTextField ticket_counter12;
/*      */   private JTextField ticket_counter13;
/*      */   private JTextField ticket_counter14;
/*      */   private JTextField ticket_counter15;
/*      */   private JTextField ticket_counter16;
/*      */   private JTextField logging;
/*      */   private JTextField logging1;
/*      */   private JTextField logging2;
/*      */   private JButton button5;
/*      */   private JTextField counter_now;
/*   73 */   private DecimalFormat[] dec = new DecimalFormat[20];
/*   74 */   private DecimalFormat decN = new DecimalFormat("000");
/*      */   private JLabel connlcd;
/*      */   private JLabel connticket;
/*      */   private SQEngine sqEngine;
/*   78 */   private boolean isStart = false;
/*   79 */   private boolean isReportShow = false;
/*      */   private JButton button6;
/*      */   private JButton button3;
/*      */   private JButton button7;
/*      */   private JCheckBox lcd;
/*      */   private JCheckBox keypad;
/*      */   private JCheckBox printer;
/*      */   private JCheckBox ticket;
/*      */   private JCheckBox panel;
/*   88 */   public Action lcdAction = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*   94 */       SQUI.this.dt.setSendToLCD(SQUI.this.lcd.isSelected());
/*      */       try {
/*   96 */         SaveConfig.getInstance(null);
/*   97 */         SaveConfig.PUT("SEND_TO_LCD", SQUI.this.lcd.isSelected() ? "1" : "0");
/*   98 */         SaveConfig.Close();
/*      */       }
/*      */       catch (FileNotFoundException e1) {
/*  101 */         e1.printStackTrace();
/*      */       }
/*      */       catch (IOException e1) {
/*  104 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*   88 */   };
/*      */ 
/*  109 */   public Action doTest = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  115 */       new Thread(new SQUI.ThreadSendLCD(SQUI.this)).start();
/*      */     }
/*  109 */   };
/*      */ 
/*  146 */   public Action keypadAction = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  152 */       SQUI.this.dt.setSendToKeyPad(SQUI.this.keypad.isSelected());
/*      */       try {
/*  154 */         SaveConfig.getInstance(null);
/*  155 */         SaveConfig.PUT("SEND_TO_KEYPAD", SQUI.this.keypad.isSelected() ? "1" : "0");
/*  156 */         SaveConfig.Close();
/*      */       }
/*      */       catch (FileNotFoundException e1) {
/*  159 */         e1.printStackTrace();
/*      */       }
/*      */       catch (IOException e1) {
/*  162 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  146 */   };
/*      */ 
/*  167 */   public Action panelAction = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  173 */       SQUI.this.dt.setSendToPanel(SQUI.this.panel.isSelected());
/*      */       try {
/*  175 */         SaveConfig.getInstance(null);
/*  176 */         SaveConfig.PUT("SEND_TO_DISPLAY", SQUI.this.panel.isSelected() ? "1" : "0");
/*  177 */         SaveConfig.Close();
/*      */       }
/*      */       catch (FileNotFoundException e1) {
/*  180 */         e1.printStackTrace();
/*      */       }
/*      */       catch (IOException e1) {
/*  183 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  167 */   };
/*      */ 
/*  188 */   public Action printerAction = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  194 */       SQUI.this.dt.setSendToPrinter(SQUI.this.printer.isSelected());
/*  195 */       SQUI.this.button7.setVisible(SQUI.this.printer.isSelected());
/*      */       try {
/*  197 */         SaveConfig.getInstance(null);
/*  198 */         SaveConfig.PUT("SEND_TO_PRINTER", SQUI.this.printer.isSelected() ? "1" : "0");
/*  199 */         SaveConfig.Close();
/*      */       }
/*      */       catch (FileNotFoundException e1) {
/*  202 */         e1.printStackTrace();
/*      */       }
/*      */       catch (IOException e1) {
/*  205 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  188 */   };
/*      */ 
/*  210 */   public Action ticketAction = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  216 */       SQUI.this.dt.setSendToTicket(SQUI.this.ticket.isSelected());
/*  217 */       SQUI.this.connticket.setIcon(new ImageIcon("images/disconnect.png"));
/*  218 */       SQUI.this.connticket.setVisible(SQUI.this.ticket.isSelected());
/*  219 */       SQUI.this.button3.setVisible(SQUI.this.ticket.isSelected());
/*      */       try {
/*  221 */         SaveConfig.getInstance(null);
/*  222 */         SaveConfig.PUT("SEND_TO_TICKET", SQUI.this.ticket.isSelected() ? "1" : "0");
/*  223 */         SaveConfig.Close();
/*      */       }
/*      */       catch (FileNotFoundException e1) {
/*  226 */         e1.printStackTrace();
/*      */       }
/*      */       catch (IOException e1) {
/*  229 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  210 */   };
/*      */ 
/*  234 */   public Action sendTicker = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  240 */       String msg = "B|" + SQUI.this.ticker.getText();
/*  241 */       LCDProps.LCD.recv(msg);
/*  242 */       TicketProps.TICKET.recv(msg);
/*      */     }
/*  234 */   };
/*      */ 
/*  246 */   public Action browseVideo = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  252 */       JFileChooser fc = new JFileChooser();
/*  253 */       fc.showOpenDialog(SQUI.this.frame);
/*  254 */       File file = fc.getSelectedFile();
/*  255 */       if (file != null)
/*  256 */         SQUI.this.video.setText(file.getName());
/*      */     }
/*  246 */   };
/*      */ 
/*  260 */   public Action doSystemConfig = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e)
/*      */     {
/*      */       try {
/*  268 */         new SystemConfig();
/*      */       }
/*      */       catch (Exception e1) {
/*  271 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  260 */   };
/*      */ 
/*  276 */   public Action doLCDConfig = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e)
/*      */     {
/*      */       try {
/*  284 */         new LCDConfiguration();
/*      */       }
/*      */       catch (Exception e1) {
/*  287 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  276 */   };
/*      */ 
/*  292 */   public Action doTicketConfig = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e)
/*      */     {
/*      */       try {
/*  300 */         new TicketConfig();
/*      */       }
/*      */       catch (Exception e1) {
/*  303 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  292 */   };
/*      */ 
/*  308 */   public Action doReset = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  314 */       SQUI.this.reset();
/*      */     }
/*  308 */   };
/*      */ 
/*  318 */   public Action doResetPerLayanan = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  324 */       Object result = JOptionPane.showInputDialog(SQUI.this.frame, "Reset Layanan yang ke: ");
/*  325 */       if (result != null)
/*      */       {
/*  327 */         int idx = Integer.parseInt(result.toString());
/*  328 */         SQUI.this.reset(idx);
/*      */       }
/*      */     }
/*  318 */   };
/*      */ 
/*  333 */   public Action doSetPrinter = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e) {
/*  339 */       if (SQUI.this.dt.isSendToTicket())
/*      */       {
/*  341 */         if (SQUI.this.ticket_counter1 != null)
/*  342 */           TicketProps.TICKET.recv("D|0|" + Integer.parseInt(SQUI.this.ticket_counter1.getText().replace(SQUI.this.dt.getServiceKode(0), "")));
/*  343 */         if (SQUI.this.ticket_counter2 != null)
/*  344 */           TicketProps.TICKET.recv("D|1|" + Integer.parseInt(SQUI.this.ticket_counter2.getText().replace(SQUI.this.dt.getServiceKode(1), "")));
/*  345 */         if (SQUI.this.ticket_counter3 != null)
/*  346 */           TicketProps.TICKET.recv("D|2|" + Integer.parseInt(SQUI.this.ticket_counter3.getText().replace(SQUI.this.dt.getServiceKode(2), "")));
/*  347 */         if (SQUI.this.ticket_counter4 != null)
/*  348 */           TicketProps.TICKET.recv("D|3|" + Integer.parseInt(SQUI.this.ticket_counter4.getText().replace(SQUI.this.dt.getServiceKode(3), "")));
/*  349 */         if (SQUI.this.ticket_counter5 != null)
/*  350 */           TicketProps.TICKET.recv("D|4|" + Integer.parseInt(SQUI.this.ticket_counter5.getText().replace(SQUI.this.dt.getServiceKode(4), "")));
/*  351 */         if (SQUI.this.ticket_counter6 != null)
/*  352 */           TicketProps.TICKET.recv("D|5|" + Integer.parseInt(SQUI.this.ticket_counter6.getText().replace(SQUI.this.dt.getServiceKode(5), "")));
/*  353 */         if (SQUI.this.ticket_counter7 != null)
/*  354 */           TicketProps.TICKET.recv("D|6|" + Integer.parseInt(SQUI.this.ticket_counter7.getText().replace(SQUI.this.dt.getServiceKode(6), "")));
/*  355 */         if (SQUI.this.ticket_counter8 != null)
/*  356 */           TicketProps.TICKET.recv("D|7|" + Integer.parseInt(SQUI.this.ticket_counter8.getText().replace(SQUI.this.dt.getServiceKode(7), "")));
/*  357 */         if (SQUI.this.ticket_counter9 != null)
/*  358 */           TicketProps.TICKET.recv("D|8|" + Integer.parseInt(SQUI.this.ticket_counter9.getText().replace(SQUI.this.dt.getServiceKode(8), "")));
/*  359 */         if (SQUI.this.ticket_counter10 != null)
/*  360 */           TicketProps.TICKET.recv("D|9|" + Integer.parseInt(SQUI.this.ticket_counter10.getText().replace(SQUI.this.dt.getServiceKode(9), "")));
/*  361 */         if (SQUI.this.ticket_counter11 != null)
/*  362 */           TicketProps.TICKET.recv("D|10|" + Integer.parseInt(SQUI.this.ticket_counter11.getText().replace(SQUI.this.dt.getServiceKode(10), "")));
/*  363 */         if (SQUI.this.ticket_counter12 != null)
/*  364 */           TicketProps.TICKET.recv("D|11|" + Integer.parseInt(SQUI.this.ticket_counter12.getText().replace(SQUI.this.dt.getServiceKode(11), "")));
/*  365 */         if (SQUI.this.ticket_counter13 != null)
/*  366 */           TicketProps.TICKET.recv("D|12|" + Integer.parseInt(SQUI.this.ticket_counter13.getText().replace(SQUI.this.dt.getServiceKode(12), "")));
/*  367 */         if (SQUI.this.ticket_counter14 != null)
/*  368 */           TicketProps.TICKET.recv("D|13|" + Integer.parseInt(SQUI.this.ticket_counter14.getText().replace(SQUI.this.dt.getServiceKode(13), "")));
/*  369 */         if (SQUI.this.ticket_counter15 != null)
/*  370 */           TicketProps.TICKET.recv("D|14|" + Integer.parseInt(SQUI.this.ticket_counter15.getText().replace(SQUI.this.dt.getServiceKode(14), "")));
/*  371 */         if (SQUI.this.ticket_counter16 != null) {
/*  372 */           TicketProps.TICKET.recv("D|15|" + Integer.parseInt(SQUI.this.ticket_counter16.getText().replace(SQUI.this.dt.getServiceKode(15), "")));
/*      */         }
/*      */ 
/*      */       }
/*  376 */       else if (SQUI.this.dt.isSendToPrinter())
/*      */       {
/*  378 */         String cmdNo = "";
/*  379 */         if (SQUI.this.ticket_counter1 != null)
/*      */         {
/*  381 */           if (SQUI.this.ticket_counter1.getText().equals("")) {
/*  382 */             SQUI.this.ticket_counter1.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  384 */           cmdNo = cmdNo + SQUI.this.ticket_counter1.getText().replace(SQUI.this.dt.getServiceKode(0), "");
/*      */         }
/*  386 */         if (SQUI.this.ticket_counter2 != null)
/*      */         {
/*  388 */           if (SQUI.this.ticket_counter2.getText().equals("")) {
/*  389 */             SQUI.this.ticket_counter2.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  391 */           cmdNo = cmdNo + SQUI.this.ticket_counter2.getText().replace(SQUI.this.dt.getServiceKode(1), "");
/*      */         }
/*  393 */         if (SQUI.this.ticket_counter3 != null)
/*      */         {
/*  395 */           if (SQUI.this.ticket_counter3.getText().equals("")) {
/*  396 */             SQUI.this.ticket_counter3.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  398 */           cmdNo = cmdNo + SQUI.this.ticket_counter3.getText().replace(SQUI.this.dt.getServiceKode(2), "");
/*      */         }
/*  400 */         if (SQUI.this.ticket_counter4 != null)
/*      */         {
/*  402 */           if (SQUI.this.ticket_counter4.getText().equals("")) {
/*  403 */             SQUI.this.ticket_counter4.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  405 */           cmdNo = cmdNo + SQUI.this.ticket_counter4.getText().replace(SQUI.this.dt.getServiceKode(3), "");
/*      */         }
/*  407 */         if (SQUI.this.ticket_counter5 != null)
/*      */         {
/*  409 */           if (SQUI.this.ticket_counter5.getText().equals("")) {
/*  410 */             SQUI.this.ticket_counter5.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  412 */           cmdNo = cmdNo + SQUI.this.ticket_counter5.getText().replace(SQUI.this.dt.getServiceKode(4), "");
/*      */         }
/*  414 */         if (SQUI.this.ticket_counter6 != null)
/*      */         {
/*  416 */           if (SQUI.this.ticket_counter6.getText().equals("")) {
/*  417 */             SQUI.this.ticket_counter6.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  419 */           cmdNo = cmdNo + SQUI.this.ticket_counter6.getText().replace(SQUI.this.dt.getServiceKode(5), "");
/*      */         }
/*  421 */         if (SQUI.this.ticket_counter7 != null)
/*      */         {
/*  423 */           if (SQUI.this.ticket_counter7.getText().equals("")) {
/*  424 */             SQUI.this.ticket_counter7.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  426 */           cmdNo = cmdNo + SQUI.this.ticket_counter7.getText().replace(SQUI.this.dt.getServiceKode(6), "");
/*      */         }
/*  428 */         if (SQUI.this.ticket_counter8 != null)
/*      */         {
/*  430 */           if (SQUI.this.ticket_counter8.getText().equals("")) {
/*  431 */             SQUI.this.ticket_counter8.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  433 */           cmdNo = cmdNo + SQUI.this.ticket_counter8.getText().replace(SQUI.this.dt.getServiceKode(7), "");
/*      */         }
/*  435 */         if (SQUI.this.ticket_counter9 != null)
/*      */         {
/*  437 */           if (SQUI.this.ticket_counter9.getText().equals("")) {
/*  438 */             SQUI.this.ticket_counter9.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  440 */           cmdNo = cmdNo + SQUI.this.ticket_counter8.getText().replace(SQUI.this.dt.getServiceKode(8), "");
/*      */         }
/*  442 */         if (SQUI.this.ticket_counter10 != null)
/*      */         {
/*  444 */           if (SQUI.this.ticket_counter10.getText().equals("")) {
/*  445 */             SQUI.this.ticket_counter10.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  447 */           cmdNo = cmdNo + SQUI.this.ticket_counter10.getText().replace(SQUI.this.dt.getServiceKode(9), "");
/*      */         }
/*  449 */         if (SQUI.this.ticket_counter11 != null)
/*      */         {
/*  451 */           if (SQUI.this.ticket_counter11.getText().equals("")) {
/*  452 */             SQUI.this.ticket_counter11.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  454 */           cmdNo = cmdNo + SQUI.this.ticket_counter11.getText().replace(SQUI.this.dt.getServiceKode(10), "");
/*      */         }
/*  456 */         if (SQUI.this.ticket_counter12 != null)
/*      */         {
/*  458 */           if (SQUI.this.ticket_counter12.getText().equals("")) {
/*  459 */             SQUI.this.ticket_counter12.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  461 */           cmdNo = cmdNo + SQUI.this.ticket_counter12.getText().replace(SQUI.this.dt.getServiceKode(11), "");
/*      */         }
/*  463 */         if (SQUI.this.ticket_counter13 != null)
/*      */         {
/*  465 */           if (SQUI.this.ticket_counter13.getText().equals("")) {
/*  466 */             SQUI.this.ticket_counter13.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  468 */           cmdNo = cmdNo + SQUI.this.ticket_counter13.getText().replace(SQUI.this.dt.getServiceKode(12), "");
/*      */         }
/*  470 */         if (SQUI.this.ticket_counter14 != null)
/*      */         {
/*  472 */           if (SQUI.this.ticket_counter14.getText().equals("")) {
/*  473 */             SQUI.this.ticket_counter14.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  475 */           cmdNo = cmdNo + SQUI.this.ticket_counter14.getText().replace(SQUI.this.dt.getServiceKode(13), "");
/*      */         }
/*  477 */         if (SQUI.this.ticket_counter15 != null)
/*      */         {
/*  479 */           if (SQUI.this.ticket_counter15.getText().equals("")) {
/*  480 */             SQUI.this.ticket_counter15.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  482 */           cmdNo = cmdNo + SQUI.this.ticket_counter15.getText().replace(SQUI.this.dt.getServiceKode(14), "");
/*      */         }
/*  484 */         if (SQUI.this.ticket_counter16 != null)
/*      */         {
/*  486 */           if (SQUI.this.ticket_counter16.getText().equals("")) {
/*  487 */             SQUI.this.ticket_counter16.setText(SQUI.this.dt.getFormat());
/*      */           }
/*  489 */           cmdNo = cmdNo + SQUI.this.ticket_counter16.getText().replace(SQUI.this.dt.getServiceKode(15), "");
/*      */         }
/*  491 */         String strCommand = SQUI.this.dt.getPrinterCommand() + cmdNo;
/*      */ 
/*  493 */         SQUI.App.writeLog("set printer: " + strCommand);
/*      */ 
/*  495 */         if (SQUI.this.sqEngine != null) {
/*  496 */           SQUI.this.sqEngine.send(strCommand);
/*      */         }
/*      */       }
/*      */       try
/*      */       {
/*  501 */         Services.MAX_COUNTER_1 = Integer.parseInt(SQUI.this.ticket_counter1.getText().replace(SQUI.this.dt.getServiceKode(0), ""));
/*  502 */         Services.MAX_COUNTER_2 = Integer.parseInt(SQUI.this.ticket_counter2.getText().replace(SQUI.this.dt.getServiceKode(1), ""));
/*  503 */         Services.MAX_COUNTER_3 = Integer.parseInt(SQUI.this.ticket_counter3.getText().replace(SQUI.this.dt.getServiceKode(2), ""));
/*  504 */         Services.MAX_COUNTER_4 = Integer.parseInt(SQUI.this.ticket_counter4.getText().replace(SQUI.this.dt.getServiceKode(3), ""));
/*  505 */         Services.MAX_COUNTER_5 = Integer.parseInt(SQUI.this.ticket_counter5.getText().replace(SQUI.this.dt.getServiceKode(4), ""));
/*  506 */         Services.MAX_COUNTER_6 = Integer.parseInt(SQUI.this.ticket_counter6.getText().replace(SQUI.this.dt.getServiceKode(5), ""));
/*  507 */         Services.MAX_COUNTER_7 = Integer.parseInt(SQUI.this.ticket_counter7.getText().replace(SQUI.this.dt.getServiceKode(6), ""));
/*  508 */         Services.MAX_COUNTER_8 = Integer.parseInt(SQUI.this.ticket_counter8.getText().replace(SQUI.this.dt.getServiceKode(7), ""));
/*  509 */         Services.MAX_COUNTER_9 = Integer.parseInt(SQUI.this.ticket_counter9.getText().replace(SQUI.this.dt.getServiceKode(8), ""));
/*  510 */         Services.MAX_COUNTER_10 = Integer.parseInt(SQUI.this.ticket_counter10.getText().replace(SQUI.this.dt.getServiceKode(9), ""));
/*  511 */         Services.MAX_COUNTER_11 = Integer.parseInt(SQUI.this.ticket_counter11.getText().replace(SQUI.this.dt.getServiceKode(10), ""));
/*  512 */         Services.MAX_COUNTER_12 = Integer.parseInt(SQUI.this.ticket_counter12.getText().replace(SQUI.this.dt.getServiceKode(11), ""));
/*  513 */         Services.MAX_COUNTER_13 = Integer.parseInt(SQUI.this.ticket_counter13.getText().replace(SQUI.this.dt.getServiceKode(12), ""));
/*  514 */         Services.MAX_COUNTER_14 = Integer.parseInt(SQUI.this.ticket_counter14.getText().replace(SQUI.this.dt.getServiceKode(13), ""));
/*  515 */         Services.MAX_COUNTER_15 = Integer.parseInt(SQUI.this.ticket_counter15.getText().replace(SQUI.this.dt.getServiceKode(14), ""));
/*  516 */         Services.MAX_COUNTER_16 = Integer.parseInt(SQUI.this.ticket_counter16.getText().replace(SQUI.this.dt.getServiceKode(15), ""));
/*      */       }
/*      */       catch (Exception localException)
/*      */       {
/*      */       }
/*      */     }
/*  333 */   };
/*      */ 
/*  524 */   public Action doReport = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e)
/*      */     {
/*      */       try {
/*  532 */         new ReportConfig();
/*      */       }
/*      */       catch (Exception e1) {
/*  535 */         e1.printStackTrace();
/*      */       }
/*      */     }
/*  524 */   };
/*      */ 
/*  540 */   public Action doStart = new AbstractAction()
/*      */   {
/*      */     private static final long serialVersionUID = 1L;
/*      */ 
/*      */     public void actionPerformed(ActionEvent e)
/*      */     {
/*      */       try {
/*  548 */         if (SQUI.this.button5.getText().equals("Start"))
/*      */         {
/*  550 */           SQUI.this.isStart = true;
/*  551 */           SQUI.this.button5.setText("Stop");
/*  552 */           if (SQUI.this.sqEngine == null)
/*  553 */             SQUI.this.sqEngine = new SQEngine();
/*      */           else
/*  555 */             SQUI.this.sqEngine.start();
/*      */         }
/*      */         else
/*      */         {
/*  559 */           SQUI.this.isStart = false;
/*  560 */           SQUI.this.button5.setText("Start");
/*  561 */           SQUI.this.sqEngine.stop();
/*      */         }
/*      */       }
/*      */       catch (Exception e1)
/*      */       {
/*  566 */         e1.printStackTrace(); }  }  } ;
/*      */ 
/*  571 */   private boolean isReset = false;
/*      */   private JTextField counter1;
/*      */   private JTextField counter2;
/*      */   private JTextField counter3;
/*      */   private JTextField counter4;
/*      */   private JTextField counter5;
/*      */   private JTextField counter6;
/*      */   private JTextField counter7;
/*      */   private JTextField counter8;
/*      */   private JTextField counter9;
/*      */   private JTextField counter10;
/*      */   private JTextField counter11;
/*      */   private JTextField counter12;
/*      */   private JTextField counter13;
/*      */   private JTextField counter14;
/*      */   private JTextField counter15;
/*      */   private JTextField counter16;
/*      */   private JTextField counter17;
/*      */   private JTextField counter18;
/*      */   private JTextField counter19;
/*      */   private JTextField counter20;
/*      */ 
/*  596 */   public SQUI() throws Exception { SwingEngine swix = new SwingEngine(this);
/*  597 */     swix.render("xml/sq.xml");
/*  598 */     this.frame.setUndecorated(true);
/*  599 */     this.frame.setVisible(true);
/*      */     try
/*      */     {
/*  602 */       initializeLogger();
/*  603 */       ReadConfig.getInstance(null);
/*  604 */       init();
/*  605 */       moveToCenterofScreen();
/*  606 */       App = this;
/*  607 */       App1 = this;
/*  608 */       if (this.dt.isSendToLCD())
/*  609 */         new LCDProps();
/*  610 */       if (this.dt.isSendToTicket()) {
/*  611 */         new TicketProps();
/*      */       }
/*  613 */       this.connticket.setIcon(new ImageIcon("images/disconnect.png"));
/*  614 */       this.connticket.setVisible(this.dt.isSendToTicket());
/*      */ 
/*  616 */       new TimerTask().start();
/*      */     }
/*      */     catch (FileNotFoundException e)
/*      */     {
/*  620 */       log.info(e.getLocalizedMessage());
/*      */     }
/*      */     catch (IOException e) {
/*  623 */       log.info(e.getLocalizedMessage());
/*      */     }
/*      */   }
/*      */ 
/*      */   private void moveToCenterofScreen()
/*      */   {
/*  629 */     Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
/*  630 */     this.frame.setLocation((screen.width - this.frame.getWidth()) / 2, (screen.height - this.frame.getHeight()) / 2);
/*      */   }
/*      */ 
/*      */   private void initializeLogger()
/*      */   {
/*  635 */     Properties logProperties = new Properties();
/*      */     try
/*      */     {
/*  638 */       logProperties.load(new FileInputStream("lib/log4j.properties"));
/*  639 */       PropertyConfigurator.configure(logProperties);
/*  640 */       log.info("Logging initialized.");
/*      */     }
/*      */     catch (IOException e)
/*      */     {
/*  644 */       throw new RuntimeException("Unable to load logging property lib/log4j.properties");
/*      */     }
/*      */   }
/*      */ 
/*      */   private void init()
/*      */   {
/*  650 */     COMMPORT.commport = ReadConfig.GET("COMMPORT");
/*  651 */     COMMPORT.baudrate = Integer.parseInt(ReadConfig.GET("BAUDRATE"));
/*  652 */     COMMPORT.databits = Integer.parseInt(ReadConfig.GET("DATABITS"));
/*  653 */     COMMPORT.stopbits = Integer.parseInt(ReadConfig.GET("STOPBITS"));
/*  654 */     COMMPORT.parity = Integer.parseInt(ReadConfig.GET("PARITY"));
/*  655 */     log.info("Commport Setting [" + COMMPORT.commport + ";" + 
/*  656 */       COMMPORT.baudrate + ";" + 
/*  657 */       COMMPORT.databits + ";" + 
/*  658 */       COMMPORT.stopbits + ";" + 
/*  659 */       COMMPORT.parity + "]");
/*      */ 
/*  661 */     this.dt = new DisplayTools();
/*  662 */     this.decN = new DecimalFormat(this.dt.getFormat());
/*  663 */     for (int i = 0; i < this.dec.length; i++)
/*      */     {
/*  665 */       this.dec[i] = new DecimalFormat(this.dt.getDisplayFormat(i));
/*      */     }
/*  667 */     initCounter();
/*      */ 
/*  669 */     this.lcd.setSelected(this.dt.isSendToLCD());
/*  670 */     this.ticket.setSelected(this.dt.isSendToTicket());
/*  671 */     this.printer.setSelected(this.dt.isSendToPrinter());
/*  672 */     this.keypad.setSelected(this.dt.isSendToKeyPad());
/*  673 */     this.panel.setSelected(this.dt.isSendToPanel());
/*  674 */     this.button3.setVisible(this.dt.isSendToTicket());
/*  675 */     this.isReportShow = (!ReadConfig.GET("REPORT").equals("0"));
/*  676 */     this.button6.setVisible(this.isReportShow);
/*  677 */     this.button7.setVisible(this.dt.isSendToPrinter());
/*  678 */     this.counter_now.setText(this.dec[0].format(Increment.LastNo));
/*      */     try
/*      */     {
/*      */       try
/*      */       {
/*  683 */         String cashier_counter = ReadConfig.GET("CASHIER_COUNTER");
/*  684 */         String[] arrCashier = cashier_counter.split("\\|");
/*  685 */         Services.MAX_COUNTER_1 = Integer.parseInt(arrCashier[0]);
/*  686 */         Services.MAX_COUNTER_2 = Integer.parseInt(arrCashier[1]);
/*  687 */         Services.MAX_COUNTER_3 = Integer.parseInt(arrCashier[2]);
/*  688 */         Services.MAX_COUNTER_4 = Integer.parseInt(arrCashier[3]);
/*  689 */         Services.MAX_COUNTER_5 = Integer.parseInt(arrCashier[4]);
/*  690 */         Services.MAX_COUNTER_6 = Integer.parseInt(arrCashier[5]);
/*  691 */         Services.MAX_COUNTER_7 = Integer.parseInt(arrCashier[6]);
/*  692 */         Services.MAX_COUNTER_8 = Integer.parseInt(arrCashier[7]);
/*  693 */         Services.MAX_COUNTER_9 = Integer.parseInt(arrCashier[8]);
/*  694 */         Services.MAX_COUNTER_10 = Integer.parseInt(arrCashier[9]);
/*  695 */         Services.MAX_COUNTER_11 = Integer.parseInt(arrCashier[10]);
/*  696 */         Services.MAX_COUNTER_12 = Integer.parseInt(arrCashier[11]);
/*  697 */         Services.MAX_COUNTER_13 = Integer.parseInt(arrCashier[12]);
/*  698 */         Services.MAX_COUNTER_14 = Integer.parseInt(arrCashier[13]);
/*  699 */         Services.MAX_COUNTER_15 = Integer.parseInt(arrCashier[14]);
/*  700 */         Services.MAX_COUNTER_16 = Integer.parseInt(arrCashier[15]);
/*      */       }
/*      */       catch (Exception localException)
/*      */       {
/*      */       }
/*  705 */       this.ticket_counter1.setText(this.dec[0].format(Services.MAX_COUNTER_1));
/*  706 */       this.ticket_counter2.setText(this.dec[1].format(Services.MAX_COUNTER_2));
/*  707 */       this.ticket_counter3.setText(this.dec[2].format(Services.MAX_COUNTER_3));
/*  708 */       this.ticket_counter4.setText(this.dec[3].format(Services.MAX_COUNTER_4));
/*  709 */       this.ticket_counter5.setText(this.dec[4].format(Services.MAX_COUNTER_5));
/*  710 */       this.ticket_counter6.setText(this.dec[5].format(Services.MAX_COUNTER_6));
/*  711 */       this.ticket_counter7.setText(this.dec[6].format(Services.MAX_COUNTER_7));
/*  712 */       this.ticket_counter8.setText(this.dec[7].format(Services.MAX_COUNTER_8));
/*  713 */       this.ticket_counter9.setText(this.dec[8].format(Services.MAX_COUNTER_9));
/*  714 */       this.ticket_counter10.setText(this.dec[9].format(Services.MAX_COUNTER_10));
/*  715 */       this.ticket_counter11.setText(this.dec[10].format(Services.MAX_COUNTER_11));
/*  716 */       this.ticket_counter12.setText(this.dec[11].format(Services.MAX_COUNTER_12));
/*  717 */       this.ticket_counter13.setText(this.dec[12].format(Services.MAX_COUNTER_13));
/*  718 */       this.ticket_counter14.setText(this.dec[13].format(Services.MAX_COUNTER_14));
/*  719 */       this.ticket_counter15.setText(this.dec[14].format(Services.MAX_COUNTER_15));
/*  720 */       this.ticket_counter16.setText(this.dec[15].format(Services.MAX_COUNTER_16));
/*      */     }
/*      */     catch (Exception localException1)
/*      */     {
/*      */     }
/*      */   }
/*      */ 
/*      */   private void reset(int index)
/*      */   {
/*      */     try
/*      */     {
/*  731 */       int idx = index - 1;
/*  732 */       if (this.dt.isSendToTicket())
/*  733 */         TicketProps.TICKET.recv("RESET");
/*  734 */       if (this.dt.isSendToLCD()) {
/*  735 */         LCDProps.LCD.recv("RESET");
/*      */       }
/*  737 */       String reset = ReadConfig.GET("RESET");
/*  738 */       StringBuffer resestPrint = new StringBuffer();
/*  739 */       if (!reset.equals(""))
/*      */       {
/*  741 */         String[] arrReset = reset.split("\\|");
/*  742 */         SaveConfig.getInstance(null);
/*  743 */         int intReset = Integer.parseInt(arrReset[idx]);
/*      */ 
/*  745 */         if (this.sqEngine != null) {
/*  746 */           this.sqEngine.reset(idx, intReset);
/*      */         }
/*  748 */         if (idx == 0)
/*      */         {
/*  750 */           this.ticket_counter1.setText(this.dec[idx].format(intReset));
/*  751 */           SaveConfig.PUT("INC_1", this.decN.format(intReset));
/*  752 */           this.counter_now.setText(this.dec[idx].format(intReset));
/*  753 */           Services.MAX_COUNTER_1 = intReset;
/*  754 */           Increment.LastNo = intReset;
/*      */         }
/*  756 */         else if (idx == 1)
/*      */         {
/*  758 */           this.ticket_counter2.setText(this.dec[idx].format(intReset));
/*  759 */           SaveConfig.PUT("INC_2", this.decN.format(intReset));
/*  760 */           Services.MAX_COUNTER_2 = intReset;
/*  761 */           com.engine.Increment2.LastNo = intReset;
/*      */         }
/*  763 */         else if (idx == 2)
/*      */         {
/*  765 */           this.ticket_counter3.setText(this.dec[idx].format(intReset));
/*  766 */           SaveConfig.PUT("INC_3", this.decN.format(intReset));
/*  767 */           Services.MAX_COUNTER_3 = intReset;
/*  768 */           com.engine.Increment3.LastNo = intReset;
/*      */         }
/*  770 */         else if (idx == 3)
/*      */         {
/*  772 */           this.ticket_counter4.setText(this.dec[idx].format(intReset));
/*  773 */           SaveConfig.PUT("INC_4", this.decN.format(intReset));
/*  774 */           Services.MAX_COUNTER_4 = intReset;
/*  775 */           com.engine.Increment4.LastNo = intReset;
/*      */         }
/*  777 */         else if (idx == 4)
/*      */         {
/*  779 */           this.ticket_counter5.setText(this.dec[idx].format(intReset));
/*  780 */           SaveConfig.PUT("INC_5", this.decN.format(intReset));
/*  781 */           Services.MAX_COUNTER_5 = intReset;
/*  782 */           com.engine.Increment5.LastNo = intReset;
/*      */         }
/*  784 */         else if (idx == 5)
/*      */         {
/*  786 */           this.ticket_counter6.setText(this.dec[idx].format(intReset));
/*  787 */           SaveConfig.PUT("INC_6", this.decN.format(intReset));
/*  788 */           Services.MAX_COUNTER_6 = intReset;
/*  789 */           com.engine.Increment6.LastNo = intReset;
/*      */         }
/*  791 */         else if (idx == 6)
/*      */         {
/*  793 */           this.ticket_counter7.setText(this.dec[idx].format(intReset));
/*  794 */           SaveConfig.PUT("INC_7", this.decN.format(intReset));
/*  795 */           Services.MAX_COUNTER_7 = intReset;
/*  796 */           com.engine.Increment7.LastNo = intReset;
/*      */         }
/*  798 */         else if (idx == 7)
/*      */         {
/*  800 */           this.ticket_counter8.setText(this.dec[idx].format(intReset));
/*  801 */           SaveConfig.PUT("INC_8", this.decN.format(intReset));
/*  802 */           Services.MAX_COUNTER_8 = intReset;
/*  803 */           com.engine.Increment8.LastNo = intReset;
/*      */         }
/*  805 */         else if (idx == 8)
/*      */         {
/*  807 */           this.ticket_counter9.setText(this.dec[idx].format(intReset));
/*  808 */           SaveConfig.PUT("INC_9", this.decN.format(intReset));
/*  809 */           Services.MAX_COUNTER_9 = intReset;
/*  810 */           com.engine.Increment9.LastNo = intReset;
/*      */         }
/*  812 */         else if (idx == 9)
/*      */         {
/*  814 */           this.ticket_counter10.setText(this.dec[idx].format(intReset));
/*  815 */           SaveConfig.PUT("INC_10", this.decN.format(intReset));
/*  816 */           Services.MAX_COUNTER_10 = intReset;
/*  817 */           com.engine.Increment10.LastNo = intReset;
/*      */         }
/*  819 */         else if (idx == 10)
/*      */         {
/*  821 */           this.ticket_counter11.setText(this.dec[idx].format(intReset));
/*  822 */           SaveConfig.PUT("INC_11", this.decN.format(intReset));
/*  823 */           Services.MAX_COUNTER_11 = intReset;
/*  824 */           com.engine.Increment11.LastNo = intReset;
/*      */         }
/*  826 */         else if (idx == 11)
/*      */         {
/*  828 */           this.ticket_counter12.setText(this.dec[idx].format(intReset));
/*  829 */           SaveConfig.PUT("INC_12", this.decN.format(intReset));
/*  830 */           Services.MAX_COUNTER_12 = intReset;
/*  831 */           com.engine.Increment12.LastNo = intReset;
/*      */         }
/*  833 */         else if (idx == 12)
/*      */         {
/*  835 */           this.ticket_counter13.setText(this.dec[idx].format(intReset));
/*  836 */           SaveConfig.PUT("INC_13", this.decN.format(intReset));
/*  837 */           Services.MAX_COUNTER_13 = intReset;
/*  838 */           com.engine.Increment13.LastNo = intReset;
/*      */         }
/*  840 */         else if (idx == 13)
/*      */         {
/*  842 */           this.ticket_counter14.setText(this.dec[idx].format(intReset));
/*  843 */           SaveConfig.PUT("INC_14", this.decN.format(intReset));
/*  844 */           Services.MAX_COUNTER_14 = intReset;
/*  845 */           com.engine.Increment14.LastNo = intReset;
/*      */         }
/*  847 */         else if (idx == 14)
/*      */         {
/*  849 */           this.ticket_counter15.setText(this.dec[idx].format(intReset));
/*  850 */           SaveConfig.PUT("INC_15", this.decN.format(intReset));
/*  851 */           Services.MAX_COUNTER_15 = intReset;
/*  852 */           com.engine.Increment15.LastNo = intReset;
/*      */         }
/*  854 */         else if (idx == 15)
/*      */         {
/*  856 */           this.ticket_counter16.setText(this.dec[idx].format(intReset));
/*  857 */           SaveConfig.PUT("INC_16", this.decN.format(intReset));
/*  858 */           Services.MAX_COUNTER_16 = intReset;
/*  859 */           com.engine.Increment16.LastNo = intReset;
/*      */         }
/*      */ 
/*  862 */         for (int j = 0; j < arrReset.length; j++)
/*      */         {
/*  864 */           if (!this.dt.isSendToPrinter())
/*      */             continue;
/*  866 */           if (j == idx) {
/*  867 */             resestPrint.append(this.decN.format(intReset));
/*      */           }
/*  869 */           else if (j == 0)
/*      */           {
/*  871 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_1));
/*      */           }
/*  873 */           else if (j == 1)
/*  874 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_2));
/*  875 */           else if (j == 2)
/*  876 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_3));
/*  877 */           else if (j == 3)
/*  878 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_4));
/*  879 */           else if (j == 4)
/*  880 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_5));
/*  881 */           else if (j == 5)
/*  882 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_6));
/*  883 */           else if (j == 6)
/*  884 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_7));
/*  885 */           else if (j == 7)
/*  886 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_8));
/*  887 */           else if (j == 8)
/*  888 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_9));
/*  889 */           else if (j == 9)
/*  890 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_10));
/*  891 */           else if (j == 10)
/*  892 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_11));
/*  893 */           else if (j == 11)
/*  894 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_12));
/*  895 */           else if (j == 12)
/*  896 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_13));
/*  897 */           else if (j == 13)
/*  898 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_14));
/*  899 */           else if (j == 14)
/*  900 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_15));
/*  901 */           else if (j == 15) {
/*  902 */             resestPrint.append(this.decN.format(Services.MAX_COUNTER_16));
/*      */           }
/*      */ 
/*      */         }
/*      */ 
/*      */       }
/*      */       else
/*      */       {
/*  910 */         JOptionPane.showMessageDialog(null, "Silahkan check RESET value in sq.props");
/*  911 */         return;
/*      */       }
/*  913 */       String strCommand = this.dt.getPrinterCommand() + resestPrint.toString();
/*  914 */       log.info("reset command: " + strCommand);
/*  915 */       writeLog("reset command: " + strCommand);
/*  916 */       if (this.sqEngine != null)
/*  917 */         this.sqEngine.send(strCommand);
/*  918 */       SaveConfig.Close();
/*      */     }
/*      */     catch (Exception localException)
/*      */     {
/*      */     }
/*      */   }
/*      */ 
/*      */   private void reset()
/*      */   {
/*      */     try
/*      */     {
/*  929 */       if (this.dt.isSendToTicket())
/*  930 */         TicketProps.TICKET.recv("RESET");
/*  931 */       if (this.dt.isSendToLCD()) {
/*  932 */         LCDProps.LCD.recv("RESET");
/*      */       }
/*      */ 
/*  935 */       String reset = ReadConfig.GET("RESET");
/*  936 */       StringBuffer resestPrint = new StringBuffer();
/*  937 */       if (!reset.equals(""))
/*      */       {
/*  939 */         String[] arrReset = reset.split("\\|");
/*  940 */         SaveConfig.getInstance(null);
/*  941 */         for (int i = 0; i < arrReset.length; i++)
/*      */         {
/*  943 */           int intReset = Integer.parseInt(arrReset[i]);
/*      */ 
/*  945 */           if (this.sqEngine != null) {
/*  946 */             this.sqEngine.reset(i, intReset);
/*      */           }
/*  948 */           if (this.dt.isSendToPrinter())
/*      */           {
/*  950 */             resestPrint.append(this.decN.format(intReset));
/*      */           }
/*  952 */           if ((i == 0) && (this.ticket_counter1 != null))
/*      */           {
/*  954 */             this.ticket_counter1.setText(this.dec[i].format(intReset));
/*  955 */             SaveConfig.PUT("INC_1", this.decN.format(intReset));
/*  956 */             this.counter_now.setText(this.dec[i].format(intReset));
/*  957 */             Services.MAX_COUNTER_1 = intReset;
/*  958 */             Increment.LastNo = intReset;
/*      */           }
/*  960 */           else if ((i == 1) && (this.ticket_counter2 != null))
/*      */           {
/*  962 */             this.ticket_counter2.setText(this.dec[i].format(intReset));
/*  963 */             SaveConfig.PUT("INC_2", this.decN.format(intReset));
/*  964 */             Services.MAX_COUNTER_2 = intReset;
/*  965 */             com.engine.Increment2.LastNo = intReset;
/*      */           }
/*  967 */           else if ((i == 2) && (this.ticket_counter3 != null))
/*      */           {
/*  969 */             this.ticket_counter3.setText(this.dec[i].format(intReset));
/*  970 */             SaveConfig.PUT("INC_3", this.decN.format(intReset));
/*  971 */             Services.MAX_COUNTER_3 = intReset;
/*  972 */             com.engine.Increment3.LastNo = intReset;
/*      */           }
/*  974 */           else if ((i == 3) && (this.ticket_counter4 != null))
/*      */           {
/*  976 */             this.ticket_counter4.setText(this.dec[i].format(intReset));
/*  977 */             SaveConfig.PUT("INC_4", this.decN.format(intReset));
/*  978 */             Services.MAX_COUNTER_4 = intReset;
/*  979 */             com.engine.Increment4.LastNo = intReset;
/*      */           }
/*  981 */           else if ((i == 4) && (this.ticket_counter5 != null))
/*      */           {
/*  983 */             this.ticket_counter5.setText(this.dec[i].format(intReset));
/*  984 */             SaveConfig.PUT("INC_5", this.decN.format(intReset));
/*  985 */             Services.MAX_COUNTER_5 = intReset;
/*  986 */             com.engine.Increment5.LastNo = intReset;
/*      */           }
/*  988 */           else if ((i == 5) && (this.ticket_counter6 != null))
/*      */           {
/*  990 */             this.ticket_counter6.setText(this.dec[i].format(intReset));
/*  991 */             SaveConfig.PUT("INC_6", this.decN.format(intReset));
/*  992 */             Services.MAX_COUNTER_6 = intReset;
/*  993 */             com.engine.Increment6.LastNo = intReset;
/*      */           }
/*  995 */           else if ((i == 6) && (this.ticket_counter7 != null))
/*      */           {
/*  997 */             this.ticket_counter7.setText(this.dec[i].format(intReset));
/*  998 */             SaveConfig.PUT("INC_7", this.decN.format(intReset));
/*  999 */             Services.MAX_COUNTER_7 = intReset;
/* 1000 */             com.engine.Increment7.LastNo = intReset;
/*      */           }
/* 1002 */           else if ((i == 7) && (this.ticket_counter8 != null))
/*      */           {
/* 1004 */             this.ticket_counter8.setText(this.dec[i].format(intReset));
/* 1005 */             SaveConfig.PUT("INC_8", this.decN.format(intReset));
/* 1006 */             Services.MAX_COUNTER_8 = intReset;
/* 1007 */             com.engine.Increment8.LastNo = intReset;
/*      */           }
/* 1009 */           else if ((i == 8) && (this.ticket_counter9 != null))
/*      */           {
/* 1011 */             this.ticket_counter9.setText(this.dec[i].format(intReset));
/* 1012 */             SaveConfig.PUT("INC_9", this.decN.format(intReset));
/* 1013 */             Services.MAX_COUNTER_9 = intReset;
/* 1014 */             com.engine.Increment9.LastNo = intReset;
/*      */           }
/* 1016 */           else if ((i == 9) && (this.ticket_counter10 != null))
/*      */           {
/* 1018 */             this.ticket_counter10.setText(this.dec[i].format(intReset));
/* 1019 */             SaveConfig.PUT("INC_10", this.decN.format(intReset));
/* 1020 */             Services.MAX_COUNTER_10 = intReset;
/* 1021 */             com.engine.Increment10.LastNo = intReset;
/*      */           }
/* 1023 */           else if ((i == 10) && (this.ticket_counter11 != null))
/*      */           {
/* 1025 */             this.ticket_counter11.setText(this.dec[i].format(intReset));
/* 1026 */             SaveConfig.PUT("INC_11", this.decN.format(intReset));
/* 1027 */             Services.MAX_COUNTER_11 = intReset;
/* 1028 */             com.engine.Increment11.LastNo = intReset;
/*      */           }
/* 1030 */           else if ((i == 11) && (this.ticket_counter12 != null))
/*      */           {
/* 1032 */             this.ticket_counter12.setText(this.dec[i].format(intReset));
/* 1033 */             SaveConfig.PUT("INC_12", this.decN.format(intReset));
/* 1034 */             Services.MAX_COUNTER_12 = intReset;
/* 1035 */             com.engine.Increment12.LastNo = intReset;
/*      */           }
/* 1037 */           else if ((i == 12) && (this.ticket_counter13 != null))
/*      */           {
/* 1039 */             this.ticket_counter13.setText(this.dec[i].format(intReset));
/* 1040 */             SaveConfig.PUT("INC_13", this.decN.format(intReset));
/* 1041 */             Services.MAX_COUNTER_13 = intReset;
/* 1042 */             com.engine.Increment13.LastNo = intReset;
/*      */           }
/* 1044 */           else if ((i == 13) && (this.ticket_counter14 != null))
/*      */           {
/* 1046 */             this.ticket_counter14.setText(this.dec[i].format(intReset));
/* 1047 */             SaveConfig.PUT("INC_14", this.decN.format(intReset));
/* 1048 */             Services.MAX_COUNTER_14 = intReset;
/* 1049 */             com.engine.Increment14.LastNo = intReset;
/*      */           }
/* 1051 */           else if ((i == 14) && (this.ticket_counter15 != null))
/*      */           {
/* 1053 */             this.ticket_counter15.setText(this.dec[i].format(intReset));
/* 1054 */             SaveConfig.PUT("INC_15", this.decN.format(intReset));
/* 1055 */             Services.MAX_COUNTER_15 = intReset;
/* 1056 */             com.engine.Increment15.LastNo = intReset;
/*      */           }
/*      */           else {
/* 1059 */             if ((i != 15) || (this.ticket_counter16 == null))
/*      */               continue;
/* 1061 */             this.ticket_counter16.setText(this.dec[i].format(intReset));
/* 1062 */             SaveConfig.PUT("INC_16", this.decN.format(intReset));
/* 1063 */             Services.MAX_COUNTER_16 = intReset;
/* 1064 */             com.engine.Increment16.LastNo = intReset;
/*      */           }
/*      */         }
/*      */ 
/* 1068 */         this.counter1.setText(this.dec[0].format(0L));
/* 1069 */         this.counter2.setText(this.dec[1].format(0L));
/* 1070 */         this.counter3.setText(this.dec[2].format(0L));
/* 1071 */         this.counter4.setText(this.dec[3].format(0L));
/* 1072 */         this.counter5.setText(this.dec[4].format(0L));
/* 1073 */         this.counter6.setText(this.dec[5].format(0L));
/* 1074 */         this.counter7.setText(this.dec[6].format(0L));
/* 1075 */         this.counter8.setText(this.dec[7].format(0L));
/* 1076 */         this.counter9.setText(this.dec[8].format(0L));
/* 1077 */         this.counter10.setText(this.dec[9].format(0L));
/* 1078 */         this.counter11.setText(this.dec[10].format(0L));
/* 1079 */         this.counter12.setText(this.dec[11].format(0L));
/* 1080 */         this.counter13.setText(this.dec[12].format(0L));
/* 1081 */         this.counter14.setText(this.dec[13].format(0L));
/* 1082 */         this.counter15.setText(this.dec[14].format(0L));
/* 1083 */         this.counter16.setText(this.dec[15].format(0L));
/* 1084 */         this.counter17.setText(this.dec[16].format(0L));
/* 1085 */         this.counter18.setText(this.dec[17].format(0L));
/* 1086 */         this.counter19.setText(this.dec[18].format(0L));
/* 1087 */         this.counter20.setText(this.dec[19].format(0L));
/*      */       }
/*      */       else {
/* 1090 */         log.info("Please check RESET value in sq.props");
/* 1091 */       }String strCommand = this.dt.getPrinterCommand() + resestPrint.toString();
/* 1092 */       writeLog("reset: " + strCommand);
/* 1093 */       if (this.sqEngine != null)
/* 1094 */         this.sqEngine.send(strCommand);
/* 1095 */       SaveConfig.Close();
/*      */     }
/*      */     catch (Exception e1) {
/* 1098 */       log.info(e1.getLocalizedMessage());
/*      */     }
/*      */   }
/*      */ 
/*      */   private void initCounter()
/*      */   {
/* 1104 */     this.counter1.setText(this.dec[0].format(0L));
/* 1105 */     this.counter2.setText(this.dec[1].format(0L));
/* 1106 */     this.counter3.setText(this.dec[2].format(0L));
/* 1107 */     this.counter4.setText(this.dec[3].format(0L));
/* 1108 */     this.counter5.setText(this.dec[4].format(0L));
/* 1109 */     this.counter6.setText(this.dec[5].format(0L));
/* 1110 */     this.counter7.setText(this.dec[6].format(0L));
/* 1111 */     this.counter8.setText(this.dec[7].format(0L));
/* 1112 */     this.counter9.setText(this.dec[8].format(0L));
/* 1113 */     this.counter10.setText(this.dec[9].format(0L));
/* 1114 */     this.counter11.setText(this.dec[10].format(0L));
/* 1115 */     this.counter12.setText(this.dec[11].format(0L));
/* 1116 */     this.counter13.setText(this.dec[12].format(0L));
/* 1117 */     this.counter14.setText(this.dec[13].format(0L));
/* 1118 */     this.counter15.setText(this.dec[14].format(0L));
/* 1119 */     this.counter16.setText(this.dec[15].format(0L));
/* 1120 */     this.counter17.setText(this.dec[16].format(0L));
/* 1121 */     this.counter18.setText(this.dec[17].format(0L));
/* 1122 */     this.counter19.setText(this.dec[18].format(0L));
/* 1123 */     this.counter20.setText(this.dec[19].format(0L));
/*      */   }
/*      */ 
/*      */   public static void main(String[] args)
/*      */     throws Exception
/*      */   {
/* 1129 */     UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel");
/* 1130 */     new SQUI();
/*      */   }
/*      */ 
/*      */   public void displayTickerCounter(int idx)
/*      */   {
/* 1135 */     if (idx == 0)
/* 1136 */       this.ticket_counter1.setText(this.dec[idx].format(Services.MAX_COUNTER_1));
/* 1137 */     else if (idx == 1)
/* 1138 */       this.ticket_counter2.setText(this.dec[idx].format(Services.MAX_COUNTER_2));
/* 1139 */     else if (idx == 2)
/* 1140 */       this.ticket_counter3.setText(this.dec[idx].format(Services.MAX_COUNTER_3));
/* 1141 */     else if (idx == 3)
/* 1142 */       this.ticket_counter4.setText(this.dec[idx].format(Services.MAX_COUNTER_4));
/* 1143 */     else if (idx == 4)
/* 1144 */       this.ticket_counter5.setText(this.dec[idx].format(Services.MAX_COUNTER_5));
/* 1145 */     else if (idx == 5)
/* 1146 */       this.ticket_counter6.setText(this.dec[idx].format(Services.MAX_COUNTER_6));
/* 1147 */     else if (idx == 6)
/* 1148 */       this.ticket_counter7.setText(this.dec[idx].format(Services.MAX_COUNTER_7));
/* 1149 */     else if (idx == 7)
/* 1150 */       this.ticket_counter8.setText(this.dec[idx].format(Services.MAX_COUNTER_8));
/* 1151 */     else if (idx == 8)
/* 1152 */       this.ticket_counter9.setText(this.dec[idx].format(Services.MAX_COUNTER_9));
/* 1153 */     else if (idx == 9)
/* 1154 */       this.ticket_counter10.setText(this.dec[idx].format(Services.MAX_COUNTER_10));
/* 1155 */     else if (idx == 10)
/* 1156 */       this.ticket_counter11.setText(this.dec[idx].format(Services.MAX_COUNTER_11));
/* 1157 */     else if (idx == 11)
/* 1158 */       this.ticket_counter12.setText(this.dec[idx].format(Services.MAX_COUNTER_12));
/* 1159 */     else if (idx == 12)
/* 1160 */       this.ticket_counter13.setText(this.dec[idx].format(Services.MAX_COUNTER_13));
/* 1161 */     else if (idx == 13)
/* 1162 */       this.ticket_counter14.setText(this.dec[idx].format(Services.MAX_COUNTER_14));
/* 1163 */     else if (idx == 14)
/* 1164 */       this.ticket_counter15.setText(this.dec[idx].format(Services.MAX_COUNTER_15));
/* 1165 */     else if (idx == 15)
/* 1166 */       this.ticket_counter16.setText(this.dec[idx].format(Services.MAX_COUNTER_16));
/*      */   }
/*      */ 
/*      */   public void recv(String data) {
/* 1170 */     parse(data);
/*      */   }
/*      */ 
/*      */   private void parse(String data)
/*      */   {
/* 1175 */     log.info("terima dari ticket->" + data);
/* 1176 */     String[] arrParse = data.split("\\|");
/* 1177 */     if (arrParse[0].equals("C"))
/*      */     {
/* 1179 */       if (!this.isStart)
/*      */       {
/* 1181 */         log.warn("system belum di start!!");
/* 1182 */         return;
/*      */       }
/* 1184 */       if (arrParse[1].equals("1"))
/*      */       {
/* 1186 */         Services.MAX_COUNTER_1 = Integer.parseInt(arrParse[2]);
/* 1187 */         log.info("[MAX_COUNTER_1]->" + Services.MAX_COUNTER_1);
/* 1188 */         this.ticket_counter1.setText(this.dec[0].format(Services.MAX_COUNTER_1));
/* 1189 */         this.sqEngine.insertMonitoring(this.dec[0].format(Services.MAX_COUNTER_1));
/*      */       }
/* 1191 */       if (arrParse[1].equals("2"))
/*      */       {
/* 1193 */         Services.MAX_COUNTER_2 = Integer.parseInt(arrParse[2]);
/* 1194 */         log.info("[MAX_COUNTER_2]->" + Services.MAX_COUNTER_2);
/* 1195 */         this.ticket_counter2.setText(this.dec[1].format(Services.MAX_COUNTER_2));
/* 1196 */         this.sqEngine.insertMonitoring(this.dec[1].format(Services.MAX_COUNTER_2));
/*      */       }
/* 1198 */       if (arrParse[1].equals("3"))
/*      */       {
/* 1200 */         Services.MAX_COUNTER_3 = Integer.parseInt(arrParse[2]);
/* 1201 */         log.info("[MAX_COUNTER_3]->" + Services.MAX_COUNTER_3);
/* 1202 */         this.ticket_counter3.setText(this.dec[2].format(Services.MAX_COUNTER_3));
/* 1203 */         this.sqEngine.insertMonitoring(this.dec[2].format(Services.MAX_COUNTER_3));
/*      */       }
/* 1205 */       if (arrParse[1].equals("4"))
/*      */       {
/* 1207 */         Services.MAX_COUNTER_4 = Integer.parseInt(arrParse[2]);
/* 1208 */         log.info("[MAX_COUNTER_4]->" + Services.MAX_COUNTER_4);
/* 1209 */         this.ticket_counter4.setText(this.dec[3].format(Services.MAX_COUNTER_4));
/* 1210 */         this.sqEngine.insertMonitoring(this.dec[3].format(Services.MAX_COUNTER_4));
/*      */       }
/* 1212 */       if (arrParse[1].equals("5"))
/*      */       {
/* 1214 */         Services.MAX_COUNTER_5 = Integer.parseInt(arrParse[2]);
/* 1215 */         log.info("[MAX_COUNTER_5]->" + Services.MAX_COUNTER_5);
/* 1216 */         this.ticket_counter5.setText(this.dec[4].format(Services.MAX_COUNTER_5));
/* 1217 */         this.sqEngine.insertMonitoring(this.dec[4].format(Services.MAX_COUNTER_5));
/*      */       }
/* 1219 */       if (arrParse[1].equals("6"))
/*      */       {
/* 1221 */         Services.MAX_COUNTER_6 = Integer.parseInt(arrParse[2]);
/* 1222 */         log.info("[MAX_COUNTER_6]->" + Services.MAX_COUNTER_6);
/* 1223 */         this.ticket_counter6.setText(this.dec[5].format(Services.MAX_COUNTER_6));
/* 1224 */         this.sqEngine.insertMonitoring(this.dec[5].format(Services.MAX_COUNTER_6));
/*      */       }
/* 1226 */       if (arrParse[1].equals("7"))
/*      */       {
/* 1228 */         Services.MAX_COUNTER_7 = Integer.parseInt(arrParse[2]);
/* 1229 */         log.info("[MAX_COUNTER_7]->" + Services.MAX_COUNTER_7);
/* 1230 */         this.ticket_counter7.setText(this.dec[6].format(Services.MAX_COUNTER_7));
/* 1231 */         this.sqEngine.insertMonitoring(this.dec[6].format(Services.MAX_COUNTER_7));
/*      */       }
/* 1233 */       if (arrParse[1].equals("8"))
/*      */       {
/* 1235 */         Services.MAX_COUNTER_8 = Integer.parseInt(arrParse[2]);
/* 1236 */         log.info("[MAX_COUNTER_8]->" + Services.MAX_COUNTER_8);
/* 1237 */         this.ticket_counter8.setText(this.dec[7].format(Services.MAX_COUNTER_8));
/* 1238 */         this.sqEngine.insertMonitoring(this.dec[7].format(Services.MAX_COUNTER_8));
/*      */       }
/* 1240 */       if (arrParse[1].equals("9"))
/*      */       {
/* 1242 */         Services.MAX_COUNTER_9 = Integer.parseInt(arrParse[2]);
/* 1243 */         log.info("[MAX_COUNTER_9]->" + Services.MAX_COUNTER_9);
/* 1244 */         this.ticket_counter9.setText(this.dec[8].format(Services.MAX_COUNTER_9));
/* 1245 */         this.sqEngine.insertMonitoring(this.dec[8].format(Services.MAX_COUNTER_9));
/*      */       }
/* 1247 */       if (arrParse[1].equals("10"))
/*      */       {
/* 1249 */         Services.MAX_COUNTER_10 = Integer.parseInt(arrParse[2]);
/* 1250 */         log.info("[MAX_COUNTER_10]->" + Services.MAX_COUNTER_10);
/* 1251 */         this.ticket_counter10.setText(this.dec[9].format(Services.MAX_COUNTER_10));
/* 1252 */         this.sqEngine.insertMonitoring(this.dec[9].format(Services.MAX_COUNTER_10));
/*      */       }
/* 1254 */       if (arrParse[1].equals("11"))
/*      */       {
/* 1256 */         Services.MAX_COUNTER_11 = Integer.parseInt(arrParse[2]);
/* 1257 */         log.info("[MAX_COUNTER_11]->" + Services.MAX_COUNTER_10);
/* 1258 */         this.ticket_counter11.setText(this.dec[10].format(Services.MAX_COUNTER_11));
/* 1259 */         this.sqEngine.insertMonitoring(this.dec[10].format(Services.MAX_COUNTER_11));
/*      */       }
/* 1261 */       if (arrParse[1].equals("12"))
/*      */       {
/* 1263 */         Services.MAX_COUNTER_12 = Integer.parseInt(arrParse[2]);
/* 1264 */         log.info("[MAX_COUNTER_12]->" + Services.MAX_COUNTER_12);
/* 1265 */         this.ticket_counter12.setText(this.dec[11].format(Services.MAX_COUNTER_12));
/* 1266 */         this.sqEngine.insertMonitoring(this.dec[11].format(Services.MAX_COUNTER_12));
/*      */       }
/* 1268 */       if (arrParse[1].equals("13"))
/*      */       {
/* 1270 */         Services.MAX_COUNTER_13 = Integer.parseInt(arrParse[2]);
/* 1271 */         log.info("[MAX_COUNTER_13]->" + Services.MAX_COUNTER_13);
/* 1272 */         this.ticket_counter13.setText(this.dec[12].format(Services.MAX_COUNTER_13));
/* 1273 */         this.sqEngine.insertMonitoring(this.dec[12].format(Services.MAX_COUNTER_13));
/*      */       }
/* 1275 */       if (arrParse[1].equals("14"))
/*      */       {
/* 1277 */         Services.MAX_COUNTER_14 = Integer.parseInt(arrParse[2]);
/* 1278 */         log.info("[MAX_COUNTER_14]->" + Services.MAX_COUNTER_14);
/* 1279 */         this.ticket_counter14.setText(this.dec[13].format(Services.MAX_COUNTER_14));
/* 1280 */         this.sqEngine.insertMonitoring(this.dec[13].format(Services.MAX_COUNTER_14));
/*      */       }
/* 1282 */       if (arrParse[1].equals("15"))
/*      */       {
/* 1284 */         Services.MAX_COUNTER_15 = Integer.parseInt(arrParse[2]);
/* 1285 */         log.info("[MAX_COUNTER_15]->" + Services.MAX_COUNTER_15);
/* 1286 */         this.ticket_counter15.setText(this.dec[14].format(Services.MAX_COUNTER_15));
/* 1287 */         this.sqEngine.insertMonitoring(this.dec[14].format(Services.MAX_COUNTER_15));
/*      */       }
/* 1289 */       if (arrParse[1].equals("16"))
/*      */       {
/* 1291 */         Services.MAX_COUNTER_16 = Integer.parseInt(arrParse[2]);
/* 1292 */         log.info("[MAX_COUNTER_16]->" + Services.MAX_COUNTER_16);
/* 1293 */         this.ticket_counter16.setText(this.dec[15].format(Services.MAX_COUNTER_16));
/* 1294 */         this.sqEngine.insertMonitoring(this.dec[15].format(Services.MAX_COUNTER_16));
/*      */       }
/*      */     }
/*      */   }
/*      */ 
/*      */   private void showTime()
/*      */   {
/* 1301 */     SimpleDateFormat sdf = new SimpleDateFormat("EEE dd/MM/yyyy HH:mm:ss");
/* 1302 */     SimpleDateFormat sdf1 = new SimpleDateFormat("HH");
/* 1303 */     Calendar cal = Calendar.getInstance();
/* 1304 */     int hour = cal.get(10);
/* 1305 */     cal.set(10, hour);
/* 1306 */     this.date.setText(sdf.format(cal.getTime()));
/* 1307 */     String strTime = sdf1.format(cal.getTime());
/* 1308 */     long lTime = Long.parseLong(strTime);
/* 1309 */     this.date.setHorizontalAlignment(0);
/* 1310 */     if ((lTime == 0L) && (!this.isReset))
/*      */     {
/* 1312 */       this.isReset = true;
/*      */ 
/* 1314 */       reset();
/*      */     }
/* 1316 */     else if (lTime > 0L)
/*      */     {
/* 1318 */       if (this.isReset)
/* 1319 */         this.isReset = false;
/*      */     }
/*      */   }
/*      */ 
/*      */   public void counter(int idx, String value)
/*      */   {
/* 1325 */     this.counter_now.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/* 1326 */     if (idx == 1)
/*      */     {
/* 1328 */       this.counter1.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1330 */     if (idx == 2)
/*      */     {
/* 1332 */       this.counter2.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1334 */     if (idx == 3)
/*      */     {
/* 1336 */       this.counter3.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1338 */     if (idx == 4)
/*      */     {
/* 1340 */       this.counter4.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1342 */     if (idx == 5)
/*      */     {
/* 1344 */       this.counter5.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1346 */     if (idx == 6)
/*      */     {
/* 1348 */       this.counter6.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1350 */     if (idx == 7)
/*      */     {
/* 1352 */       this.counter7.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1354 */     if (idx == 8)
/*      */     {
/* 1356 */       this.counter8.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1358 */     if (idx == 9)
/*      */     {
/* 1360 */       this.counter9.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1362 */     if (idx == 10)
/*      */     {
/* 1364 */       this.counter10.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1366 */     if (idx == 11)
/*      */     {
/* 1368 */       this.counter11.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1370 */     if (idx == 12)
/*      */     {
/* 1372 */       this.counter12.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1374 */     if (idx == 13)
/*      */     {
/* 1376 */       this.counter13.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1378 */     if (idx == 14)
/*      */     {
/* 1380 */       this.counter14.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1382 */     if (idx == 15)
/*      */     {
/* 1384 */       this.counter15.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1386 */     if (idx == 16)
/*      */     {
/* 1388 */       this.counter16.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1390 */     if (idx == 17)
/*      */     {
/* 1392 */       this.counter17.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1394 */     if (idx == 18)
/*      */     {
/* 1396 */       this.counter18.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1398 */     if (idx == 19)
/*      */     {
/* 1400 */       this.counter19.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/* 1402 */     if (idx == 20)
/*      */     {
/* 1404 */       this.counter20.setText(this.dec[(idx - 1)].format(Double.parseDouble(value)));
/*      */     }
/*      */   }
/*      */ 
/*      */   public void connect(int idx)
/*      */   {
/* 1410 */     if (idx == 0)
/* 1411 */       this.connlcd.setIcon(new ImageIcon("images/connect.png"));
/*      */     else
/* 1413 */       this.connticket.setIcon(new ImageIcon("images/connect.png"));
/*      */   }
/*      */ 
/*      */   public void disconnect(int idx)
/*      */   {
/* 1418 */     if (idx == 0)
/* 1419 */       this.connlcd.setIcon(new ImageIcon("images/disconnect.png"));
/*      */     else
/* 1421 */       this.connticket.setIcon(new ImageIcon("images/disconnect.png"));
/*      */   }
/*      */ 
/*      */   public void writeLog(String msg)
/*      */   {
/* 1426 */     if (this.logging != null)
/* 1427 */       this.logging.setText(msg);
/*      */   }
/*      */ 
/*      */   public void writeLogRecv(String msg)
/*      */   {
/* 1432 */     if (this.logging1 != null)
/* 1433 */       this.logging1.setText(msg);
/*      */   }
/*      */ 
/*      */   public void writeLogLCD(String msg)
/*      */   {
/* 1438 */     if (this.logging2 != null)
/* 1439 */       this.logging2.setText(msg); 
/*      */   }
/*      */   public void display(int idx, int no) {
/*      */   }
/*      */ 
/*      */   class TestSendToLCD extends Thread {
/* 1444 */     final DecimalFormat dec1 = new DecimalFormat("00");
/* 1445 */     final DecimalFormat dec = new DecimalFormat(SQUI.this.dt.getFormat());
/*      */ 
/*      */     public TestSendToLCD()
/*      */     {
/*      */     }
/*      */ 
/*      */     public void run()
/*      */     {
/* 1453 */       int counter = 1;
/* 1454 */       int lstNo = 100;
/* 1455 */       int maxCounter = 5;
/*      */       while (true)
/*      */       {
/* 1458 */         if (SQUI.this.dt.isSendToLCD())
/*      */         {
/* 1460 */           if (counter == maxCounter) {
/* 1461 */             counter = 0;
/*      */           }
/* 1463 */           String msg = "A|" + this.dec1.format(counter) + "|" + this.dec.format(lstNo);
/* 1464 */           System.out.println(msg);
/* 1465 */           LCDProps.LCD.recv(msg);
/* 1466 */           counter++;
/* 1467 */           lstNo++;
/*      */           try {
/* 1469 */             Thread.sleep(6000L);
/*      */           }
/*      */           catch (InterruptedException e) {
/* 1472 */             e.printStackTrace();
/*      */           }
/* 1456 */           continue;
/*      */         }
/*      */       }
/*      */     }
/*      */   }
/*      */ 
/*      */   public class ThreadSendLCD
/*      */     implements Runnable
/*      */   {
/*      */     public ThreadSendLCD()
/*      */     {
/*      */     }
/*      */ 
/*      */     public void run()
/*      */     {
/*  125 */       int display = 1;
/*  126 */       int idx = 1;
/*      */       while (true)
/*      */       {
/*  129 */         String msg = "A|00" + idx + "|" + display++;
/*  130 */         LCDProps.LCD.recv(msg);
/*  131 */         idx++;
/*  132 */         if (idx == 3)
/*  133 */           idx = 1;
/*      */         try
/*      */         {
/*  136 */           Thread.sleep(3000L);
/*      */         }
/*      */         catch (InterruptedException e1) {
/*  139 */           e1.printStackTrace();
/*      */         }
/*      */       }
/*      */     }
/*      */   }
/*      */ 
/*      */   class TimerTask extends Thread
/*      */   {
/*      */     public TimerTask()
/*      */     {
/*      */     }
/*      */ 
/*      */     public void run()
/*      */     {
/*      */       while (true)
/*      */       {
/* 1490 */         SQUI.this.showTime();
/*      */         try {
/* 1492 */           Thread.sleep(1000L);
/*      */         }
/*      */         catch (InterruptedException localInterruptedException)
/*      */         {
/*      */         }
/*      */       }
/*      */     }
/*      */   }
/*      */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.ui.SQUI
 * JD-Core Version:    0.6.0
 */